Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repl: fix top level await with surrogate characters #39931

Closed
wants to merge 2 commits into from

Conversation

Mesteery
Copy link
Member

Fixes: #39929

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem. labels Aug 29, 2021
lib/internal/repl/await.js Outdated Show resolved Hide resolved
@Trott Trott added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Aug 29, 2021
@Mesteery
Copy link
Member Author

Mesteery commented Aug 29, 2021

This does not work for entries like await "😀😀😀";"😀".
edit: I think I finally succeeded.
edit: It's more complicated than I thought. 😅

@Mesteery Mesteery closed this Aug 29, 2021
@Mesteery Mesteery reopened this Aug 29, 2021
@Mesteery Mesteery closed this Aug 29, 2021
@Mesteery Mesteery deleted the repl-await-surrogates branch August 29, 2021 17:29
@Mesteery Mesteery restored the repl-await-surrogates branch August 29, 2021 18:01
@Trott
Copy link
Member

Trott commented Aug 29, 2021

This does not work for entries like await "😀😀😀";"😀".
edit: I think I finally succeeded.
edit: It's more complicated than I thought. 😅

While getting it exactly right is, of course, preferred, it's totally OK to land something that is an improvement that still leaves some edge cases unsolved. await "😀😀😀";"😀" doesn't work currently, so it's OK if your fix doesn't fix that.

@Mesteery
Copy link
Member Author

Ok, thanks! Finally I succeeded, and I don't know why I was looking for a complex solution. Just break the surrogates, so the array has the same length as the string and the surrogates will normally not be broken at the end (unless there is a bug with some indexes or acorn, but I doubt it)

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@VoltrexKeyva VoltrexKeyva added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Aug 30, 2021
@Trott Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 30, 2021
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 30, 2021
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Sep 2, 2021
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 2, 2021
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Sep 6, 2021

@targos targos self-assigned this Sep 8, 2021
targos pushed a commit to targos/node that referenced this pull request Sep 8, 2021
Fixes: nodejs#39929

PR-URL: nodejs#39931
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
@targos
Copy link
Member

targos commented Sep 8, 2021

Landed in addb30f

@targos targos closed this Sep 8, 2021
@targos targos removed their assignment Sep 8, 2021
@Mesteery Mesteery deleted the repl-await-surrogates branch September 8, 2021 19:16
BethGriggs pushed a commit that referenced this pull request Sep 21, 2021
Fixes: #39929

PR-URL: #39931
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
@BethGriggs BethGriggs mentioned this pull request Sep 21, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

await an expression with surrogate characters raises a SyntaxError
9 participants